package com.demo.base.pojo;

import java.io.Serializable;
import java.util.List;

public class pagedDate<T> implements Serializable {
    private int pageSize;
    private int pageIndex;
    private int totalpageCount;
    private int totalCount;
    private List<T> list;
    private boolean hasNext;
    private boolean hasPrivious;

    public pagedDate(int pageSize, int pageIndex, int totalCount, List<T> list) {
        this.pageSize = pageSize;
        this.pageIndex = pageIndex;
        this.totalCount = totalCount;
        this.list = list;
        System.out.println(totalCount+"totalCount");
        System.out.println(pageSize+"pageSize");
        this.totalpageCount = this.totalCount % this.pageSize == 0 ? (this.totalCount / this.pageSize) : (this.totalCount / this.pageSize + 1);
    }

    public pagedDate() {
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public int getPageIndex() {
        return pageIndex;
    }

    public void setPageIndex(int pageIndex) {
        this.pageIndex = pageIndex;
    }

    public int getTotalpageCount() {
        return totalpageCount;
    }

    public void setTotalpageCount(int totalpageCount) {
        this.totalpageCount = totalpageCount;
    }

    public int getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(int totalCount) {
        this.totalCount = totalCount;
    }

    public List<T> getList() {
        return list;
    }

    public void setList(List<T> list) {
        this.list = list;
    }

    public boolean isHasNext() {
        return this.pageIndex < this.totalpageCount;
    }

    public void setHasNext(boolean hasNext) {
        this.hasNext = hasNext;
    }

    public boolean isHasPrivious() {
        return this.pageIndex > 1;
    }

    public void setHasPrivious(boolean hasPrivious) {
        this.hasPrivious = hasPrivious;
    }
}
